<?php

namespace App\Models;

use Daijulong\LaravelRoles\Traits\PermissionRoleModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class UserRole extends Model
{
    use SoftDeletes, PermissionRoleModel;

    protected $fillable = [
        'name',
        'alias',
        'description',
        'permissions',
    ];

    public function scopeEnabled($query)
    {
        return $query;
    }

    public function users()
    {
        return $this->hasMany(User::class, 'role_id');
    }
}
